#ifndef HTML_DOCUMENT_H_INCLUDED
#define HTML_DOCUMENT_H_INCLUDED

#include "html_tag.h"
#include "html_attribute.h"

class html_document
{
    public:

    html_document() : current_t(0), first_t(0) {};

    ~html_document()
    {
        html_tag *c = 0;
        for (int i =0;i< (int)html_t.size();i++)
        {
            c = html_t[i];
            if (!c) break;

            html_attrib* a = c->first_child;
            if (a)
            {
                while(a)
                {
                    html_attrib* last = a;
                    a = a->next;

                    delete last; // delete atribute
                }
            }

           delete c; // delete tag
        }
    };

    vector<html_tag*>   html_t; // list of attributes

    html_tag*           current_t; // currently processing
    html_tag*           first_t; // first tag


};

#endif // HTML_DOCUMENT_H_INCLUDED
